package org.marsdonne.auth;

import lombok.Getter;
import org.marsdonne.archives.Client;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

@Getter
public class UserSecret extends User {
    private Long id;
    private String realName;
    private Integer residentRegionCode;
    private Client client;
    private boolean working = false;
    private Long orgId;
    private String orgLicenseCode;
    private String orgName;
    private Integer orgRegionCode;

    public UserSecret(Long id, String username, String password, Collection<? extends GrantedAuthority> authorities, String realName, Integer residentRegionCode, Client client, Long orgId, String orgLicenseCode, String orgName, Integer orgRegionCode, boolean working) {
        super(username, password, authorities);
        this.id = id;
        this.realName = realName;
        this.residentRegionCode = residentRegionCode;
        this.client = client;
        this.working = working;
        this.orgId = orgId;
        this.orgLicenseCode = orgLicenseCode;
        this.orgName = orgName;
        this.orgRegionCode = orgRegionCode;
    }

    public UserSecret(Long id, String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities, String realName, Integer residentRegionCode, Long orgId, String orgLicenseCode, String orgName, Integer orgRegionCode, boolean working) {
        super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
        this.id = id;
        this.realName = realName;
        this.residentRegionCode = residentRegionCode;
        this.working = working;
        this.orgId = orgId;
        this.orgLicenseCode = orgLicenseCode;
        this.orgName = orgName;
        this.orgRegionCode = orgRegionCode;
    }
}
